package code

const (
	RESPONSE_SUCCESS      = 200
	ERROR_PARAM_CODE      = 400
	RESPONSE_IllegalToken = 5008

	ERROR_PARAM = iota
	ERROR_DB_QUERY
	ERROR_DB_UPDATE
	ERROR_DB_INSERT
	ERROR_DB_NOT_FOUND
)

// Error Error
type Error struct {
	Code    int
	Message string
}

var (
	Errors = map[int]Error{
		ERROR_PARAM:        {4001, "输入参数有误"},
		ERROR_DB_QUERY:     {5000, "查询错误"},
		ERROR_DB_UPDATE:    {5001, "修改错误"},
		ERROR_DB_INSERT:    {5002, "新增错误"},
		ERROR_DB_NOT_FOUND: {404, "未找到"},
	}
)
